package com.sun.controller;

import com.sun.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class UerController {

    @Autowired
    private UserService userService;


    public UerController() {
        System.out.println("userController 被创建了" );
    }

    @RequestMapping("/hello")
    public String hello(@RequestParam(value = "username") String user, Model model){
        model.addAttribute("user", user);
        return "hello";
    }
}
